using System;
using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class RowGroupingType
    {

        private GTame.ReportParser.DynamicColumnsRowsType _DynamicRows;
        private System.Nullable<bool> _FixedHeader;
        private GTame.ReportParser.StaticRowsType _StaticRows;
        private string _Width;

        public GTame.ReportParser.DynamicColumnsRowsType DynamicRows
        {
            get
            {
                if (_DynamicRows == null)
                    _DynamicRows = new GTame.ReportParser.DynamicColumnsRowsType();
                return _DynamicRows;
            }
            set
            {
                _DynamicRows = value;
            }
        }

        public System.Nullable<bool> FixedHeader
        {
            get
            {
                return _FixedHeader;
            }
            set
            {
                _FixedHeader = value;
            }
        }

        public GTame.ReportParser.StaticRowsType StaticRows
        {
            get
            {
                if (_StaticRows == null)
                    _StaticRows = new GTame.ReportParser.StaticRowsType();
                return _StaticRows;
            }
            set
            {
                _StaticRows = value;
            }
        }

        public string Width
        {
            get
            {
                return _Width;
            }
            set
            {
                _Width = value;
            }
        }

        public RowGroupingType()
        {
            _FixedHeader = new System.Nullable<bool>[]();
        }

        public Rdl.RowGroupingType Write()
        {
            Rdl.RowGroupingType rowGroupingType = new Rdl.RowGroupingType();
            System.Collections.ArrayList arrayList = new System.Collections.ArrayList();
            if (_DynamicRows != null)
                arrayList.Add(_DynamicRows.Write());
            if (_FixedHeader.get_HasValue())
                arrayList.Add(_FixedHeader);
            if (_StaticRows != null)
                arrayList.Add(_StaticRows.Write());
            if (_Width != null)
                arrayList.Add(_Width);
            rowGroupingType.Items = arrayList.ToArray();
            arrayList = null;
            return rowGroupingType;
        }

    } // class RowGroupingType

}

